package cn.ilikes.tools.nosql.jpa.configs.envs.sys;

import java.util.ArrayList;
import java.util.List;
import java.util.Properties;

import org.slf4j.Logger;

import cn.ilikes.tools.logs.Loggerfactory;
import cn.ilikes.tools.nosql.jpa.JPASQLSystemEnv;
import cn.ilikes.tools.nosql.jpa.configs.envs.JPASQLConfigurationException;

public class SystemEnvConfigure implements IConfigure {

	private static Logger logger = Loggerfactory.instance(SystemEnvConfigure.class);

	private Properties properties;

	private List<IConfigure> configures = new ArrayList<IConfigure>();

	public SystemEnvConfigure(Properties properties) {
		this.properties = properties;
		init();
	}

	/**
	 * config 初始化
	 */
	private void init() {
		//		PersistenceUnitPaserConfigs persistenceUnitPaserConfigs=new PersistenceUnitPaserConfigs(properties);
		//		configures.add(persistenceUnitPaserConfigs);
	}

	@Override
	public void config(JPASQLSystemEnv systemEnv) throws JPASQLConfigurationException {
		Loggerfactory.info(logger, "JPA NOSQL Start Paser   Configs");
		for (IConfigure configure : configures) {
			configure.config(systemEnv);
		}
		systemEnv.init();

	}

}
